home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / src / RCS / getloadavg.c,v < prev    next >
Encoding:
Text File  |  1991-06-25  |  30.0 KB  |  1,479 lines

  1. head    1.16;
  2. access;
  3. symbols
  4.     RELEASE:1.16
  5.     BETA:1.12;
  6. locks; strict;
  7. comment    @ * @;
  8.  
  9.  
  10. 1.16
  11. date    91.06.21.12.51.15;    author paul;    state Exp;
  12. branches;
  13. next    1.15;
  14.  
  15. 1.15
  16. date    91.06.20.19.17.29;    author paul;    state Exp;
  17. branches;
  18. next    1.14;
  19.  
  20. 1.14
  21. date    91.06.13.19.55.52;    author paul;    state Exp;
  22. branches;
  23. next    1.13;
  24.  
  25. 1.13
  26. date    91.06.05.17.18.27;    author paul;    state Exp;
  27. branches;
  28. next    1.12;
  29.  
  30. 1.12
  31. date    91.06.01.22.18.25;    author paul;    state Exp;
  32. branches;
  33. next    1.11;
  34.  
  35. 1.11
  36. date    91.05.29.19.32.55;    author paul;    state Exp;
  37. branches;
  38. next    1.10;
  39.  
  40. 1.10
  41. date    91.05.23.21.33.42;    author paul;    state Exp;
  42. branches;
  43. next    1.9;
  44.  
  45. 1.9
  46. date    91.04.05.14.55.15;    author paul;    state Exp;
  47. branches;
  48. next    1.8;
  49.  
  50. 1.8
  51. date    91.03.28.20.43.17;    author paul;    state Exp;
  52. branches;
  53. next    1.7;
  54.  
  55. 1.7
  56. date    91.03.28.18.19.52;    author paul;    state Exp;
  57. branches;
  58. next    1.6;
  59.  
  60. 1.6
  61. date    91.03.22.05.13.53;    author paul;    state Exp;
  62. branches;
  63. next    1.5;
  64.  
  65. 1.5
  66. date    91.03.05.21.38.22;    author paul;    state Exp;
  67. branches;
  68. next    1.4;
  69.  
  70. 1.4
  71. date    91.01.10.22.25.33;    author paul;    state Exp;
  72. branches;
  73. next    1.3;
  74.  
  75. 1.3
  76. date    90.11.29.10.46.24;    author paul;    state Exp;
  77. branches;
  78. next    1.2;
  79.  
  80. 1.2
  81. date    90.11.26.21.13.35;    author paul;    state Exp;
  82. branches;
  83. next    1.1;
  84.  
  85. 1.1
  86. date    90.11.19.16.11.54;    author paul;    state Exp;
  87. branches;
  88. next    ;
  89.  
  90.  
  91. desc
  92. @Load Average code from the MIT X11R4 distribution.  What goes around,
  93. comes around.
  94. @
  95.  
  96.  
  97. 1.16
  98. log
  99. @Apollos now use proc1_$get_loadav() which greatly simplified the routine.
  100. The previous code is wrapped in #ifdef notdef if needed.  From Chrisos S.
  101. Zoulas (christos@@ee.cornell.edu).
  102. @
  103. text
  104. @/*
  105.  * Copyright 1989 Massachusetts Institute of Technology
  106.  *
  107.  * Permission to use, copy, modify, distribute, and sell this software and its
  108.  * documentation for any purpose is hereby granted without fee, provided that
  109.  * the above copyright notice appear in all copies and that both that
  110.  * copyright notice and this permission notice appear in supporting
  111.  * documentation, and that the name of M.I.T. not be used in advertising or
  112.  * publicity pertaining to distribution of the software without specific,
  113.  * written prior permission.  M.I.T. makes no representations about the
  114.  * suitability of this software for any purpose.  It is provided "as is"
  115.  * without express or implied warranty.
  116.  *
  117.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  118.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  119.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  120.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  121.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  122.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  123.  *
  124.  * Authors:  Many and varied...
  125.  */
  126.  
  127. #ifndef lint
  128. static char sccs_id[] = "%W%";
  129. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.15 1991/06/20 19:17:29 paul Exp paul $";
  130. #endif /* !lint */
  131.  
  132. #include "conf.h"
  133.  
  134. /* Necessary as AIX has a typedef for syserr [err.c] in sysinfo.h */
  135. #ifndef _AIX
  136. # include "sendmail.h"
  137. #endif /* !_AIX */
  138.  
  139. #ifdef DGUX
  140. # include <sys/dg_sys_info.h>
  141.  
  142. int getloadavg( call_data )
  143.      caddr_t    call_data;    /* pointer to (double) return value */
  144. {    
  145.     struct dg_sys_info_load_info load_info;
  146.  
  147.     dg_sys_info(&load_info,
  148.         DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
  149.  
  150.     *(double *)call_data = load_info.one_minute;
  151. }
  152. #else /* DGUX */
  153.  
  154. # ifdef UMAX
  155. /*
  156.  *
  157.  *    FOR: Encore multimax UMAX 4.3.
  158.  *
  159.  *    Extracted from get_stats() (written by John Robert LoVerso)
  160.  *    by Neil Rickert.
  161.  *
  162.  *    Use inq_stats() to determine boottime, load average
  163.  *
  164.  */
  165.  
  166. #  include <sys/param.h> /* */
  167. #  include <inq_stats/statistics.h>
  168. #  include <inq_stats/procstats.h>
  169.  
  170. /*
  171.  * see dimension of ps_nrun[] in procstats.h
  172.  */
  173. #  ifndef PS_NRUNSIZE
  174. #   define PS_NRUNSIZE 300
  175. #  endif
  176.  
  177. /*
  178.  * Each entry in ps_nrun[] is count of runnable processes sampled every
  179.  * 5 seconds.  period[] contains the number of samples to use for the
  180.  * intervals of {1,5,15} minutes.  cexp[] contains constans for exponential
  181.  * decay.
  182.  */
  183. #  define period 12
  184.  
  185. int getloadavg( call_data )
  186.      caddr_t    call_data;    /* pointer to (double) return value */
  187. {
  188.     struct stat_descr    Proc_info;
  189.     struct proc_summary    Proc_sum_data;
  190.     register int i, index, interval;
  191.  
  192.     /*
  193.      * struct to get process summary data,
  194.      * esp circular buffer containing counts of runnable processes
  195.      */
  196.     Proc_info.sd_next = NULL;
  197.     Proc_info.sd_subsys = SUBSYS_PROC;
  198.     Proc_info.sd_type = PROCTYPE_SUMMARY;
  199.     Proc_info.sd_addr = (char *) &Proc_sum_data;
  200.     Proc_info.sd_size = sizeof (struct proc_summary);
  201.     Proc_info.sd_sizeused = 0;
  202.  
  203.     /*
  204.      * fill in Boot_data and Proc_sum_data structures
  205.      */
  206.     if (inq_stats(1, &Proc_info) != 0) {
  207. #  ifdef LOG
  208.         syslog(LOG_WARNING, "getloadavg: inq_stats(): %m");
  209. #  endif /* LOG */
  210.         return (-1);
  211.     }
  212.  
  213.     /*
  214.      * fastest (inverse shared sum) loop
  215.      */
  216.     index = Proc_sum_data.ps_nrunidx;
  217.     interval = 0;
  218.     *(double *)call_data = 0.0;
  219.     for (; interval < period; interval++) {
  220.         *(double *)call_data += Proc_sum_data.ps_nrun[index];
  221.         if (--index < 0)
  222.             index = PS_NRUNSIZE-1;
  223.         }
  224.  
  225.         *(double *)call_data /= period;
  226. }
  227. # else /* UMAX */
  228.  
  229. #  ifdef _AIX
  230. /*
  231.  * This version of this module (get_load.c) is specifically for the IBM
  232.  * S/6000 AIX 3.1 platform. The copyright below applies to this module
  233.  * only.
  234.  *
  235.  * Copyright (C) 1990 by the University of Illinois Board of Trustees.
  236.  *
  237.  * This code is distributed in the hope that it will be useful,
  238.  * but without any warranty.  No author or distributor accepts
  239.  * responsibility to anyone for the consequences of using it or for
  240.  * whether it serves any particular purpose or works at all, unless
  241.  * s/he says so in writing.
  242.  *
  243.  * Author: Charley Kline, University of Illinois Computing Services
  244.  *         c-kline@@uiuc.edu
  245.  *
  246.  */
  247.  
  248. #   include <sys/sysinfo.h>
  249. #   include <unistd.h>
  250. #   include <fcntl.h>
  251. #   include <syslog.h>
  252. #   include <math.h>
  253. #   include <nlist.h>
  254.  
  255. struct nlist kernelnames[] = {
  256.     {"sysinfo", 0, 0, 0, 0, 0},
  257.     {NULL, 0, 0, 0, 0, 0},
  258. };
  259.  
  260.  
  261. /* ARGSUSED */
  262. int 
  263. getloadavg (call_data)
  264.     caddr_t  call_data;    /* pointer to (double) return value */
  265. {
  266.     double *loadavg = (double *)call_data;
  267.     double   loadav;
  268.     static double avenrun = 0.;
  269.     struct sysinfo si;
  270.     static int rq_old = 0, ro_old = 0;
  271.     static   initted = 0;
  272.     static int fd;
  273.     double   multiplier;
  274.     double   t;
  275.  
  276.     /*
  277.      * * Do stuff we only need to do once per invocation, like opening *
  278.      * the kmem file and fetching the parts of the symbol table.
  279.      */
  280.     if (!initted) {
  281.         initted = 1;
  282.         knlist (kernelnames, 1, sizeof (struct nlist));
  283.         if ((fd = open ("/dev/kmem", O_RDONLY)) < 0)
  284.         {
  285. #   ifdef LOG
  286.             syslog(LOG_WARNING, "getloadavg: open /dev/kmem: %m");
  287. #   endif /* LOG */
  288.             return (-1);
  289.         }
  290.     }
  291.     /*
  292.      * * Get the system info structure from the running kernel.
  293.      */
  294.     lseek (fd, kernelnames[0].n_value, SEEK_SET);
  295.     if (read (fd, (char *)&si, sizeof (struct sysinfo)) != sizeof (struct sysinfo))
  296.     {
  297. #   ifdef LOG
  298.             syslog(LOG_WARNING, "getloadavg: read /dev/kmem: %m");
  299. #   endif /* LOG */
  300.             return (-1);
  301.     }
  302.  
  303.     /*
  304.      * AIX doesn't keep the load average variables in the kernel; all
  305.      * we can get is the current number of runnable processes by
  306.      * observing the difference between the runque and runocc values in
  307.      * sysinfo. Having done this, however, we can apply a TENEX-style
  308.      * exponential time-average to it by computing an averaging multiplier
  309.      * based on the sampling interval. This is then used to factor in *
  310.      * the current number of running processes to our running load
  311.      * average. The result "looks right" when observed in conjunction
  312.      * with the process table and user activity.
  313.      * 
  314.      * We subtract one from the number of running processes given us by
  315.      * the kernel because for some reason AIX always calls one of the
  316.      * kernel processes "runnable" even though it uses very little CPU.
  317.      * Subtracting this out gives a load average near zero when the
  318.      * machine is mostly idle, which is more familiar to those of us who
  319.      * are used to bsd-style load averages.
  320.      */
  321.     t = (double) (si.runocc - ro_old);
  322.     loadav = (double) (si.runque - rq_old) / t - 1.0;
  323.     rq_old = si.runque;
  324.     ro_old = si.runocc;
  325.     multiplier = exp (-t / 60.);
  326.     avenrun = multiplier * avenrun + (1.0 - multiplier) * loadav;
  327.     /*
  328.      * DEBUG printf("%d %d %f %f %f\n", si.runque, si.runocc, t, loadav,
  329.      * avenrun);
  330.      */
  331.  
  332.     *loadavg = avenrun;
  333.     return (0);
  334. }
  335. #  else /* !_AIX */
  336.  
  337. /*
  338.  * Get open(2) constants
  339.  */
  340. #   ifdef SYSV
  341. #    ifndef macII
  342. #     include <fcntl.h>
  343. #    endif /* !macII */
  344. #   endif /* SYSV */
  345. #   include <sys/file.h>
  346. #   ifdef USG
  347. #    include <unistd.h>
  348. #   endif /* USG */
  349.  
  350. #   ifdef att
  351. #    define LOADSTUB
  352. #   endif /* att */
  353.  
  354. #   ifdef apollo
  355. #    include <apollo/base.h>
  356. #    include <apollo/time.h>
  357. #    ifdef notdef
  358. typedef struct {
  359.     short        state;        /* ready, waiting, etc. */
  360.     pinteger    usr;        /* user sr */
  361.     linteger    upc;        /* user pc */
  362.     linteger    usp;        /* user stack pointer */
  363.     linteger    usb;        /* user sb ptr (A6) */
  364.     time_$clock_t    cpu_total;    /* cumulative cpu used by process */
  365.     unsigned short    priority;    /* process priority */
  366.     } proc1_$info_t;
  367.  
  368. /*  Enable function prototypes for ANSI C and C++  */
  369. #     if (defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)) \
  370.     && !defined(__GNUC__)
  371. #      define _PROTOTYPES
  372. #     endif /* (__STDC__ || c_plusplus || __cplusplus) && !__GNUC__ */
  373.  
  374. void proc1_$get_cput(
  375. #     ifdef _PROTOTYPES
  376.     time_$clock_t    *cput
  377. #     endif /* _PROTOTYPES */
  378. );
  379.  
  380. void proc1_$get_info(
  381. #     ifdef _PROTOTYPES
  382.     short        &pid,
  383.     proc1_$info_t    *info,
  384.     status_$t    *sts
  385. #     endif /* _PROTOTYPES */
  386. );
  387. #     ifdef _PROTOTYPES
  388. #      undef _PROTOTYPES
  389. #     endif /* _PROTOTYPES */
  390.  
  391. #    endif /* notdef */
  392. #   endif /* apollo */
  393.  
  394. #   if !defined(macII) && !defined(apollo) && !defined(LOADSTUB)
  395. #    include <nlist.h>
  396. #   endif /* !macII && !apollo && !LOADSTUB */
  397.  
  398. #   ifdef sun
  399. #    include <sys/param.h>
  400. #    ifdef i386
  401. #     include <kvm.h>
  402. #     define    KVM_ROUTINES
  403. #    endif /* i386 */
  404. #   endif /* sun */
  405.  
  406. #   if defined(mips) && !defined(sgi)
  407. #    include <sys/fixpoint.h>
  408. #   endif /* mips && !sgi */
  409.  
  410. #   ifdef CRAY
  411. #    include <sys/param.h>
  412. #    include <sys/sysinfo.h>
  413. #    undef n_type
  414. #    define n_type n_value
  415. #   endif /* CRAY */
  416.  
  417. #   ifdef vax
  418. #    include <sys/param.h>
  419. #   endif /* vax */
  420.  
  421. #   ifdef sequent
  422. #    include <sys/vm.h>
  423. #   endif /* sequent */
  424.  
  425. #   ifdef macII
  426. #    include <a.out.h>
  427. #    include <sys/var.h>
  428. #    define X_AVENRUN 0
  429. #    define fxtod(i) (vec[i].high+(vec[i].low/65536.0))
  430. struct lavnum {
  431.     unsigned short high;
  432.     unsigned short low;
  433. };
  434. #   endif /* macII */
  435.  
  436. #   ifdef unixpc
  437. #    define FSCALE    64.0
  438. #   endif /* unixpc */
  439.  
  440. #   if defined(UTEK) || defined(alliant)
  441. #    define FSCALE    100.0
  442. #   endif /* UTEK || alliant */
  443.  
  444. #   if (defined(sequent) || defined(NeXT) || defined(sgi)) && !defined(FSCALE)
  445. #    define FSCALE    1000.0
  446. #   endif /* (sequent || NeXT || sgi) && !FSCALE */
  447.  
  448. #   ifdef hp9000
  449. #    include <sys/param.h>
  450. #   endif /* hp9000 */
  451.  
  452. #   ifndef FSCALE
  453. #    define    FSHIFT    8    /* bits to right of fixed binary point */
  454. #    define    FSCALE    (1<<FSHIFT)
  455. #   endif /* !FSCALE */
  456.  
  457. #   ifdef __STDC__
  458. extern off_t lseek(int, off_t, int);
  459. extern void exit(int);
  460. #   else /* !__STDC__ */
  461. extern long lseek();
  462. extern void exit();
  463. #   endif /* __STDC__ */
  464.  
  465. #   if apollo
  466. /* ARGSUSED */
  467. int getloadavg( call_data )
  468.      caddr_t    call_data;    /* pointer to (double) return value */
  469. {
  470. #    ifdef notdef
  471.      static int     firstTime = 1;
  472.      static int     lastNullCpu;
  473.      static int     lastClock;
  474.      time_$clock_t  timeNow;
  475.      double         temp;
  476.      proc1_$info_t  info;
  477.      status_$t      st;
  478.  
  479.      proc1_$get_info( (short) 2, &info, &st );
  480.      time_$clock( &timeNow );
  481.  
  482.      if (firstTime)
  483.      {
  484.          *(double *)call_data = 1.0;
  485.          firstTime = 0;
  486.      }
  487.      else {
  488.          temp = info.cpu_total.low32 - lastNullCpu;
  489.          *(double *)call_data = 1.0 - temp / (timeNow.low32 - lastClock);
  490.      }
  491.  
  492.      lastClock = timeNow.low32;
  493.      lastNullCpu = info.cpu_total.low32;
  494.      return(0);
  495. #    else /* !notdef */
  496.      double *avenrun = (double *) call_data;
  497.      int i;
  498.      status_$t      st;
  499.      long loadav[3];
  500.      proc1_$get_loadav(loadav, &st);
  501.      *avenrun = loadav[0] / (double) (1 << 16);
  502.      return(0);
  503. #    endif /* notdef */
  504. }
  505. #   else /* !apollo */
  506. #    ifdef KVM_ROUTINES
  507. /*
  508.  *    Sun 386i Code - abstracted to see the wood for the trees
  509.  */
  510.  
  511. /* ARGSUSED */
  512. void 
  513. getloadavg( call_data )
  514.      caddr_t    call_data;    /* pointer to (double) return value */
  515. {
  516.     double *loadavg = (double *)call_data;
  517.     long    temp;
  518.     static int init = 0;
  519.     static struct nlist nl[2];
  520.     static kvm_t *kd;
  521.     
  522.     if (!init) {
  523.     kd = kvm_open("/vmunix", NULL, NULL, O_RDONLY, NULL);
  524.     if (kd == (kvm_t *)0) {
  525. #    ifdef LOG
  526.         syslog(LOG_WARNING, "getloadavg: kvm_open /vmunix: %m");
  527. #    endif /* LOG */
  528.         return (-1);
  529.     }
  530.     
  531.     nl[0].n_name = "avenrun";
  532.     nl[1].n_name = NULL;
  533.     
  534.     if (kvm_nlist(kd, nl) != 0) {
  535. #    ifdef LOG
  536.         syslog(LOG_WARNING, "getloadavg: kvm_nlist /vmunix: %m");
  537. #    endif /* LOG */
  538.         return (-1);
  539.     }
  540.     init = 1;
  541.     }
  542.     
  543.     if (nl[0].n_value == 0) {
  544.         return (-1);
  545.     }
  546.     if (kvm_read(kd, nl[0].n_value, (char *)&temp, sizeof (temp)) != 
  547.     sizeof (temp)) {
  548. #    ifdef LOG
  549.         syslog(LOG_WARNING, "getloadavg: kvm_read /vmunix: %m");
  550. #    endif /* LOG */
  551.     return (-1);
  552.     }
  553.     *loadavg = (double)temp/FSCALE;
  554.     return(0);
  555. }
  556. #    else /* !KVM_ROUTINES */
  557. #     ifdef LOADSTUB
  558.  
  559. /* ARGSUSED */
  560. int getloadavg( call_data )
  561.      caddr_t    call_data;    /* pointer to (double) return value */
  562. {
  563.     *(double *)call_data = 1.0;
  564. }
  565.  
  566. #     else /* !LOADSTUB */
  567.  
  568. #      ifndef KMEM_FILE
  569. #       define KMEM_FILE "/dev/kmem"
  570. #      endif /* !KMEM_FILE */
  571.  
  572. #      ifndef KERNEL_FILE
  573.  
  574. #       ifdef NeXT
  575. #        define KERNEL_FILE "/mach"
  576. #       endif /* NeXT */
  577.  
  578. #       ifdef alliant
  579. #        define KERNEL_FILE "/unix"
  580. #       endif /* alliant */
  581.  
  582. #       ifdef CRAY
  583. #        define KERNEL_FILE "/unicos"
  584. #       endif /* CRAY */
  585.  
  586. #       ifdef hpux
  587. #        define KERNEL_FILE "/hp-ux"
  588. #       endif /* hpux */
  589.  
  590. #       ifdef macII
  591. #        define KERNEL_FILE "/unix"
  592. #       endif /* macII */
  593.  
  594. #       ifdef mips
  595. #        ifdef SYSTYPE_SYSV
  596. #         define KERNEL_FILE "/unix"
  597. #        else /* !SYSTYPE_SYSV */
  598. #         define KERNEL_FILE "/vmunix"
  599. #        endif /* SYSTYPE_SYSV */
  600. #       endif /* mips */
  601.  
  602. #       ifdef sequent
  603. #        define KERNEL_FILE "/dynix"
  604. #       endif /* sequent */
  605.  
  606. /*
  607.  * provide default for everyone else
  608.  */
  609. #       ifndef KERNEL_FILE
  610. #        ifdef SYSV
  611. #         define KERNEL_FILE "/unix"
  612. #        else /* !SYSV */
  613. #         define KERNEL_FILE "/vmunix"
  614. #        endif /* SYSV */
  615. #       endif /* KERNEL_FILE */
  616. #      endif /* KERNEL_FILE */
  617.  
  618. #      ifndef KERNEL_LOAD_VARIABLE
  619. /*
  620.  * provide default
  621.  */
  622. #       ifdef USG
  623. #        define KERNEL_LOAD_VARIABLE "sysinfo"
  624. #        define SYSINFO
  625. #       else /* !USG */
  626. #        define KERNEL_LOAD_VARIABLE "_avenrun"
  627. #       endif /* USG */
  628.  
  629. #       ifdef alliant
  630. #        undef KERNEL_LOAD_VARIABLE
  631. #        define KERNEL_LOAD_VARIABLE "_Loadave"
  632. #       endif /* alliant */
  633.  
  634. #       ifdef CRAY
  635. #        if defined(CRAY2) && OSMAJORVERSION == 4
  636. #         undef KERNEL_LOAD_VARIABLE
  637. #         define KERNEL_LOAD_VARIABLE "avenrun"
  638. #        else /* !CRAY2 || OSMAJORVERSION != 4 */
  639. #         undef KERNEL_LOAD_VARIABLE
  640. #         define KERNEL_LOAD_VARIABLE "sysinfo"
  641. #         define SYSINFO
  642. #        endif /* CRAY2 && OSMAJORVERSION == 4 */
  643. #       endif /* CRAY */
  644.  
  645. #      ifdef hpux
  646. #       ifdef hp9000s800
  647. #        undef KERNEL_LOAD_VARIABLE
  648. #        define KERNEL_LOAD_VARIABLE "avenrun"
  649. #       endif /* hp9000s800 */
  650. #      endif /* hpux */
  651.  
  652. #      ifdef mips
  653. #       ifdef SYSTYPE_SYSV
  654. #        undef KERNEL_LOAD_VARIABLE
  655. #        define KERNEL_LOAD_VARIABLE "avenrun"
  656. #       else /* !SYSTYPE_SYSV */
  657. #        undef KERNEL_LOAD_VARIABLE
  658. #        define KERNEL_LOAD_VARIABLE "_avenrun"
  659. #       endif /* SYSTYPE_SYSV */
  660. #      endif /* mips */
  661.  
  662. #      ifdef unixpc
  663. #       undef KERNEL_LOAD_VARIABLE
  664. #       define KERNEL_LOAD_VARIABLE "avenrun"
  665. #      endif /* unixpc */
  666. #     endif /* KERNEL_LOAD_VARIABLE */
  667.  
  668. #     ifdef macII
  669. struct var v;
  670. static int pad[2];    /* This padding is needed if getloadavg compiled on */
  671.             /* a/ux 1.1 is executed on a/ux 1.0, because */
  672.             /* the var structure had too much padding in 1.0, */
  673.             /* so the 1.0 kernel writes past the end of the 1.1 */
  674.             /* var structure in the uvar() call. */
  675. static struct nlist nl[2];
  676. static struct lavnum vec[3];
  677. #     else /* not macII */
  678. static struct nlist namelist[] = {        /* namelist for vmunix grubbing */
  679. #      define LOADAV 0
  680. #      ifdef NeXT
  681.     {{KERNEL_LOAD_VARIABLE}},
  682.     {{0},0}
  683. #      else /* !NeXT */
  684. #       ifdef unixpc
  685.     { KERNEL_LOAD_VARIABLE, },
  686.     { (char *)0, },
  687. #       else /* !unixpc */
  688.     {KERNEL_LOAD_VARIABLE},
  689.     {0}
  690. #       endif /* unixpc */
  691. #      endif /* NeXT */
  692. };
  693. #     endif /* macII */
  694.  
  695.  
  696. /* ARGSUSED */
  697. int getloadavg( call_data )
  698.      caddr_t    call_data;    /* pointer to (double) return value */
  699. {
  700.       double *loadavg = (double *)call_data;
  701.     static int init = 0;
  702.     static kmem;
  703.     static long loadavg_seek;
  704. #     ifdef macII
  705. #      ifdef __STDC__
  706.         extern int nlist(const char *, struct nlist *);
  707. #      else /* !__STDC__ */
  708.         extern int nlist();
  709. #      endif /* __STDC__ */
  710.  
  711.         if(!init)   {
  712.             int i;
  713.  
  714.             (void) strcpy(nl[0].n_name, "avenrun");
  715.             nl[1].n_name[0] = '\0';
  716.  
  717.             kmem = open(KMEM_FILE, O_RDONLY);
  718.             if (kmem < 0) {
  719. #     ifdef LOG
  720.             syslog(LOG_WARNING, "getloadavg: open %s: %m", KMEM_FILE);
  721. #     endif /* LOG */
  722.         return (-1);
  723.         }
  724.  
  725.             uvar(&v);
  726.  
  727.             if (nlist( KERNEL_FILE, nl) != 0) {
  728. #     ifdef LOG
  729.             syslog(LOG_WARNING, "getloadavg: nlist %s: %m", KERNEL_FILE);
  730. #     endif /* LOG */
  731.         return (-1);
  732.         }
  733.             for (i = 0; i < 2; i++) {
  734.                 nl[i].n_value = (int)nl[i].n_value - v.v_kvoffset;
  735.             }
  736.             init = 1;
  737.         }
  738. #     else /* !macII */
  739. #      ifdef unixpc
  740. #       ifdef __STDC__
  741.         extern int nlist(const char *, struct nlist *);
  742. #       else /* !__STDC__ */
  743.         extern int nlist();
  744. #       endif /* __STDC__ */
  745.  
  746.     if (!init)
  747.     {
  748.         if (nlist(KERNEL_FILE, namelist) != 0)
  749.             return (-1);
  750.         loadavg_seek = (long)namelist[0].n_value;
  751.         if ((kmem = open(KMEM_FILE, O_RDONLY)) < 0)
  752.             return (-1);
  753.         init = 1;
  754.         }
  755. #      else /* !unixpc */
  756. #       if !defined(sgi) && !defined(BSD4_4)
  757.     extern void nlist();
  758. #       else /* sgi || BSD4_4 */
  759.     extern nlist();
  760. #       endif /* !sgi && !BSD4_4 */
  761.  
  762.     if(!init)   {
  763.         nlist( KERNEL_FILE, namelist);
  764. /*
  765.  * Some systems appear to set only one of these to Zero if the entry could
  766.  * not be found, I hope no_one returns Zero as a good value, or bad things
  767.  * will happen to you.  (I have a hard time believing the value will
  768.  * ever really be zero anyway).   CDP 5/17/89.
  769.  */
  770.         if (namelist[LOADAV].n_type == 0 ||
  771.         namelist[LOADAV].n_value == 0) {
  772.         return (-1);
  773.         }
  774.         loadavg_seek = namelist[LOADAV].n_value;
  775. #       if defined(mips) && defined(SYSTYPE_SYSV)
  776.         loadavg_seek &= 0x7fffffff;
  777. #       endif /* mips && SYSTYPE_SYSV */
  778. #       if defined(CRAY) && defined(SYSINFO)
  779.          loadavg_seek += ((char *) (((struct sysinfo *)NULL)->avenrun)) -
  780.                         ((char *) NULL);
  781. #       endif /* CRAY && SYSINFO */
  782.  
  783.         kmem = open(KMEM_FILE, O_RDONLY);
  784.         if (kmem < 0) {
  785. #       ifdef LOG
  786.             syslog(LOG_WARNING, "getloadavg: open %s: %m", KMEM_FILE);
  787. #       endif /* LOG */
  788.         return (-1);
  789.         }
  790.         init = 1;
  791.     }
  792. #      endif /* unixpc */
  793.     (void) lseek(kmem, loadavg_seek, 0);
  794. #     endif /* macII */
  795. #     if defined(sun) || defined (UTEK) || defined(sequent) || \
  796.       defined(alliant) || defined(hp9000) || defined(sgi) || defined(NeXT) || \
  797.       defined(unixpc)
  798.     {
  799.         long temp;
  800.         (void) read(kmem, (char *)&temp, sizeof(long));
  801.         *loadavg = (double)temp/FSCALE;
  802.     }
  803. #     else /* !sun && !UTEK && !sequent && !alliant && !hp9000 && !sgi && !NeXT && !unixpc */
  804. #      ifdef macII
  805.         {
  806.                 lseek(kmem, (long)nl[X_AVENRUN].n_value, 0);
  807.                 read(kmem, vec, 3*sizeof(struct lavnum));
  808.                 *loadavg = fxtod(0);
  809.         }
  810. #      else /* !macII */
  811. #       if defined(mips)
  812.     {
  813.         fix temp;
  814.         (void) read(kmem, (char *)&temp, sizeof(fix));
  815.         *loadavg = FIX_TO_DBL(temp);
  816.     }
  817. #       else /* !mips */
  818.     (void) read(kmem, (char *)loadavg, sizeof(double));
  819. #        endif /* mips */
  820. #       endif /* macII */
  821. #      endif /* sun || UTEK || sequent || alliant || hp9000 || sgi || NeXT || unixpc */
  822.     return(0);
  823. }
  824. #     endif /* LOADSTUB */
  825. #    endif /* KVM_ROUTINES */
  826. #   endif /* apollo */
  827. #  endif /* _AIX */
  828. # endif /* UMAX */
  829. #endif /* DGUX */
  830. @
  831.  
  832.  
  833. 1.15
  834. log
  835. @ANSI C changes for unixpc.
  836. @
  837. text
  838. @d26 1
  839. a26 1
  840. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.14 1991/06/13 19:55:52 paul Exp paul $";
  841. d254 1
  842. d266 4
  843. a269 3
  844. #    if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
  845. #     define _PROTOTYPES
  846. #    endif
  847. d272 1
  848. a272 1
  849. #    ifdef _PROTOTYPES
  850. d274 1
  851. a274 1
  852. #    endif /* _PROTOTYPES */
  853. d278 1
  854. a278 1
  855. #    ifdef _PROTOTYPES
  856. d282 1
  857. a282 1
  858. #    endif /* _PROTOTYPES */
  859. d284 3
  860. a286 3
  861. #    ifdef _PROTOTYPES
  862. #     undef _PROTOTYPES
  863. #    endif /* _PROTOTYPES */
  864. d288 1
  865. d367 1
  866. d392 9
  867. @
  868.  
  869.  
  870. 1.14
  871. log
  872. @unixpc patch.
  873. @
  874. text
  875. @d26 1
  876. a26 1
  877. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.13 1991/06/05 17:18:27 paul Exp paul $";
  878. d351 4
  879. d357 1
  880. d589 5
  881. a593 1
  882.         extern nlist();
  883. d624 5
  884. a628 3
  885.         extern    int    nlist();
  886.     extern    int    open();
  887.     extern    int    read();
  888. @
  889.  
  890.  
  891. 1.13
  892. log
  893. @Fix for SGI.
  894. @
  895. text
  896. @d26 1
  897. a26 1
  898. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.12 1991/06/01 22:18:25 paul Exp paul $";
  899. d665 1
  900. a665 1
  901.  
  902. a666 1
  903. #      endif /* unixpc */
  904. @
  905.  
  906.  
  907. 1.12
  908. log
  909. @De-linting (omitted voids).
  910. @
  911. text
  912. @d26 1
  913. a26 1
  914. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.11 1991/05/29 19:32:55 paul Exp paul $";
  915. d338 1
  916. a338 1
  917. #   if (defined(sequent) || defined(NeXT)) && !defined(FSCALE)
  918. d340 1
  919. a340 1
  920. #   endif /* (sequent || NeXT) && !FSCALE */
  921. @
  922.  
  923.  
  924. 1.11
  925. log
  926. @Load average code for the AT&T unix pc from Bruce Lilly.
  927. @
  928. text
  929. @d26 1
  930. a26 1
  931. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.10 1991/05/23 21:33:42 paul Exp paul $";
  932. d589 1
  933. a589 1
  934.             strcpy(nl[0].n_name, "avenrun");
  935. @
  936.  
  937.  
  938. 1.10
  939. log
  940. @Now includes conf.h and, if not an AIX box that defines syserr as something
  941. else, sendmail.h.  This is necessary for moving compilation defines from
  942. the command line into config files.
  943. @
  944. text
  945. @d25 2
  946. a26 1
  947. static char  rcsid[] = "@@(#)$Id: getloadavg.c,v 1.9 1991/04/05 14:55:15 paul Exp paul $";
  948. d201 5
  949. a205 5
  950.      * * AIX doesn't keep the load average variables in the kernel; all *
  951.      * we can get is the current number of runnable processes by *
  952.      * observing the difference between the runque and runocc values * in
  953.      * sysinfo. Having done this, however, we can apply a TENEX-style *
  954.      * exponential time-average to it by computing an averaging multiplier *
  955. d208 2
  956. a209 2
  957.      * average. * The result "looks right" when observed in conjunction
  958.      * with the * process table and user activity. *
  959. d211 3
  960. a213 3
  961.      * We subtract one from the number of running processes given us by *
  962.      * the kernel because for some reason AIX always calls one of the *
  963.      * kernel processes "runnable" even though it uses very little CPU. *
  964. d215 2
  965. a216 2
  966.      * machine * is mostly idle, which is more familiar to those of us who
  967.      * are * used to bsd-style load averages.
  968. d330 4
  969. d541 4
  970. a544 3
  971. #      ifdef sequent
  972. #       define KERNEL_FILE "/dynix"
  973. #      endif /* sequent */
  974. d563 4
  975. d569 1
  976. d614 16
  977. a629 1
  978. #      if !defined(sgi) && !defined(BSD4_4)
  979. d631 1
  980. a631 1
  981. #      else /* sgi || BSD4_4 */
  982. d633 1
  983. a633 1
  984. #      endif /* !sgi && !BSD4_4 */
  985. d648 1
  986. a648 1
  987. #      if defined(mips) && defined(SYSTYPE_SYSV)
  988. d650 2
  989. a651 2
  990. #      endif /* mips && SYSTYPE_SYSV */
  991. #      if defined(CRAY) && defined(SYSINFO)
  992. d654 1
  993. a654 1
  994. #      endif /* CRAY && SYSINFO */
  995. d658 1
  996. a658 1
  997. #      ifdef LOG
  998. d660 1
  999. a660 1
  1000. #      endif /* LOG */
  1001. d667 1
  1002. d670 2
  1003. a671 1
  1004.       defined(alliant) || defined(hp9000) || defined(sgi) || defined(NeXT)
  1005. d677 1
  1006. a677 1
  1007. #     else /* !sun && !UTEK && !sequent && !alliant && !hp9000 && !sgi && !NeXT */
  1008. d695 1
  1009. a695 1
  1010. #      endif /* sun || UTEK || sequent || alliant || hp9000 || sgi || NeXT */
  1011. @
  1012.  
  1013.  
  1014. 1.9
  1015. log
  1016. @Added RCS ID string
  1017. @
  1018. text
  1019. @d25 1
  1020. a25 1
  1021. static char  rcsid[] = "@@(#)$Id$";
  1022. d28 7
  1023. a34 1
  1024. #include <sys/types.h>
  1025. a62 1
  1026. #  include <sys/time.h> /* */
  1027. a144 1
  1028. #   include <sys/types.h>
  1029. d147 1
  1030. @
  1031.  
  1032.  
  1033. 1.8
  1034. log
  1035. @Added AIX load averaging code, cleaned up # indents.
  1036. @
  1037. text
  1038. @d17 1
  1039. a17 2
  1040.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  1041. AN ACTION
  1042. d23 4
  1043. @
  1044.  
  1045.  
  1046. 1.7
  1047. log
  1048. @Fixed for NeXT.
  1049. @
  1050. text
  1051. @d27 1
  1052. a27 1
  1053. #include <sys/dg_sys_info.h>
  1054. d41 1
  1055. a41 1
  1056. #ifdef UMAX
  1057. d53 4
  1058. a56 4
  1059. #include <sys/param.h> /* */
  1060. #include <sys/time.h> /* */
  1061. #include <inq_stats/statistics.h>
  1062. #include <inq_stats/procstats.h>
  1063. d61 3
  1064. a63 3
  1065. #ifndef PS_NRUNSIZE
  1066. #define PS_NRUNSIZE 300
  1067. #endif
  1068. d71 1
  1069. a71 1
  1070. #define period 12
  1071. d95 4
  1072. a98 2
  1073.         perror("inq_stats");
  1074.         exit(1);
  1075. d115 109
  1076. a223 1
  1077. #else /* UMAX */
  1078. d228 17
  1079. a244 17
  1080. #ifdef SYSV
  1081. #ifndef macII
  1082. #include <fcntl.h>
  1083. #endif
  1084. #endif /* SYSV */
  1085. #include <sys/file.h>
  1086. #ifdef USG
  1087. #include <unistd.h>
  1088. #endif
  1089.  
  1090. #ifdef att
  1091. #define LOADSTUB
  1092. #endif
  1093.  
  1094. #ifdef apollo
  1095. #include <apollo/base.h>
  1096. #include <apollo/time.h>
  1097. d256 3
  1098. a258 3
  1099. #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
  1100. #    define _PROTOTYPES
  1101. #endif
  1102. d261 1
  1103. a261 1
  1104. #ifdef _PROTOTYPES
  1105. d263 1
  1106. a263 1
  1107. #endif
  1108. d267 1
  1109. a267 1
  1110. #ifdef _PROTOTYPES
  1111. d271 1
  1112. a271 1
  1113. #endif
  1114. d273 5
  1115. a277 13
  1116. #ifdef _PROTOTYPES
  1117. #   undef _PROTOTYPES
  1118. #endif
  1119.  
  1120. #endif /* apollo */
  1121.  
  1122. #ifndef macII
  1123. #ifndef apollo
  1124. #ifndef LOADSTUB
  1125. #include <nlist.h>
  1126. #endif /* LOADSTUB */
  1127. #endif /* apollo */
  1128. #endif /* macII */
  1129. d279 5
  1130. a283 1
  1131. #ifdef sun
  1132. d286 2
  1133. a287 2
  1134. #        include <kvm.h>
  1135. #        define    KVM_ROUTINES
  1136. d289 5
  1137. a293 1
  1138. #endif
  1139. d295 20
  1140. a314 24
  1141. #if defined(mips) && !defined(sgi)
  1142. #include <sys/fixpoint.h>
  1143. #endif
  1144.  
  1145. #ifdef    CRAY
  1146. #include <sys/param.h>
  1147. #include <sys/sysinfo.h>
  1148. #undef n_type
  1149. #define n_type n_value
  1150. #endif    /* CRAY */
  1151.  
  1152. #ifdef vax
  1153. #include <sys/param.h>
  1154. #endif /* sequent */
  1155.  
  1156. #ifdef sequent
  1157. #include <sys/vm.h>
  1158. #endif /* sequent */
  1159.  
  1160. #ifdef macII
  1161. #include <a.out.h>
  1162. #include <sys/var.h>
  1163. #define X_AVENRUN 0
  1164. #define fxtod(i) (vec[i].high+(vec[i].low/65536.0))
  1165. d319 5
  1166. a323 1
  1167. #endif /* macII */
  1168. d325 3
  1169. a327 16
  1170. #if defined(UTEK) || defined(alliant)
  1171. #define FSCALE    100.0
  1172. #endif
  1173.  
  1174. #if (defined(sequent) || defined(NeXT)) && !defined(FSCALE)
  1175. #define FSCALE    1000.0
  1176. #endif
  1177.  
  1178. #ifdef hp9000
  1179. #include <sys/param.h>
  1180. #endif
  1181.  
  1182. #ifndef FSCALE
  1183. #define    FSHIFT    8        /* bits to right of fixed binary point */
  1184. #define    FSCALE    (1<<FSHIFT)
  1185. #endif /* not FSCALE */
  1186. d329 9
  1187. d341 1
  1188. a341 1
  1189. #if apollo
  1190. d371 2
  1191. a372 2
  1192. #else
  1193. #ifdef KVM_ROUTINES
  1194. d391 3
  1195. d401 3
  1196. d414 3
  1197. d422 2
  1198. a423 2
  1199. #else /* KVM_ROUTINES */
  1200. #ifdef LOADSTUB
  1201. d432 35
  1202. a466 1
  1203. #else /* LOADSTUB */
  1204. d468 3
  1205. a470 37
  1206. #ifndef KMEM_FILE
  1207. #define KMEM_FILE "/dev/kmem"
  1208. #endif
  1209.  
  1210. #ifndef KERNEL_FILE
  1211.  
  1212. #ifdef NeXT
  1213. #define KERNEL_FILE "/mach"
  1214. #endif /* NeXT */
  1215.  
  1216. #ifdef alliant
  1217. #define KERNEL_FILE "/unix"
  1218. #endif /* alliant */
  1219.  
  1220. #ifdef CRAY
  1221. #define KERNEL_FILE "/unicos"
  1222. #endif /* CRAY */
  1223.  
  1224. #ifdef hpux
  1225. #define KERNEL_FILE "/hp-ux"
  1226. #endif /* hpux */
  1227.  
  1228. #ifdef macII
  1229. #define KERNEL_FILE "/unix"
  1230. #endif /* macII */
  1231.  
  1232. #ifdef mips
  1233. # ifdef SYSTYPE_SYSV
  1234. # define KERNEL_FILE "/unix"
  1235. # else
  1236. # define KERNEL_FILE "/vmunix"
  1237. # endif /* SYSTYPE_SYSV */
  1238. #endif /* mips */
  1239.  
  1240. #ifdef sequent
  1241. #define KERNEL_FILE "/dynix"
  1242. #endif /* sequent */
  1243. d475 8
  1244. a482 8
  1245. #ifndef KERNEL_FILE
  1246. #ifdef SYSV
  1247. #define KERNEL_FILE "/unix"
  1248. #else
  1249. #define KERNEL_FILE "/vmunix"
  1250. #endif /* SYSV */
  1251. #endif /* KERNEL_FILE */
  1252. #endif /* KERNEL_FILE */
  1253. d484 1
  1254. a484 1
  1255. #ifndef KERNEL_LOAD_VARIABLE
  1256. d488 1
  1257. a488 1
  1258. #    ifdef USG
  1259. d491 1
  1260. a491 1
  1261. #    else
  1262. d493 1
  1263. a493 1
  1264. #    endif
  1265. d495 1
  1266. a495 1
  1267. #    ifdef alliant
  1268. d498 1
  1269. a498 1
  1270. #    endif /* alliant */
  1271. d500 1
  1272. a500 1
  1273. #    ifdef CRAY
  1274. d502 15
  1275. a516 15
  1276. #            undef KERNEL_LOAD_VARIABLE
  1277. #            define KERNEL_LOAD_VARIABLE "avenrun"
  1278. #        else
  1279. #            undef KERNEL_LOAD_VARIABLE
  1280. #            define KERNEL_LOAD_VARIABLE "sysinfo"
  1281. #            define SYSINFO
  1282. #        endif /* defined(CRAY2) && OSMAJORVERSION == 4 */
  1283. #    endif /* CRAY */
  1284.  
  1285. #    ifdef hpux
  1286. #        ifdef hp9000s800
  1287. #            undef KERNEL_LOAD_VARIABLE
  1288. #            define KERNEL_LOAD_VARIABLE "avenrun"
  1289. #        endif /* hp9000s800 */
  1290. #    endif /* hpux */
  1291. d518 9
  1292. a526 9
  1293. #    ifdef mips
  1294. #        ifdef SYSTYPE_SYSV
  1295. #            undef KERNEL_LOAD_VARIABLE
  1296. #            define KERNEL_LOAD_VARIABLE "avenrun"
  1297. #        else
  1298. #            undef KERNEL_LOAD_VARIABLE
  1299. #            define KERNEL_LOAD_VARIABLE "_avenrun"
  1300. #        endif /* SYSTYPE_SYSV */
  1301. #    endif /* mips */
  1302. d528 4
  1303. a531 4
  1304. #    ifdef sequent
  1305. #        define KERNEL_FILE "/dynix"
  1306. #    endif /* sequent */
  1307. #endif /* KERNEL_LOAD_VARIABLE */
  1308. d533 1
  1309. a533 1
  1310. #ifdef macII
  1311. d542 1
  1312. a542 1
  1313. #else /* not macII */
  1314. d544 2
  1315. a545 2
  1316. #define LOADAV 0
  1317. # ifdef NeXT
  1318. d548 1
  1319. a548 1
  1320. # else /* !NeXT */
  1321. d551 1
  1322. a551 1
  1323. # endif /* NeXT */
  1324. d553 1
  1325. a553 1
  1326. #endif /* macII */
  1327. d564 1
  1328. a564 1
  1329. #ifdef macII
  1330. d575 3
  1331. d584 3
  1332. d594 2
  1333. a595 2
  1334. #else /* not macII */
  1335. # if !defined(sgi) && !defined(BSD4_4)
  1336. d597 1
  1337. a597 1
  1338. # else
  1339. d599 2
  1340. a600 2
  1341. # endif /* !sgi */
  1342.     
  1343. d614 1
  1344. a614 1
  1345. #if defined(mips) && defined(SYSTYPE_SYSV)
  1346. d616 2
  1347. a617 2
  1348. #endif /* mips && SYSTYPE_SYSV */
  1349. #if (defined(CRAY) && defined(SYSINFO))
  1350. d620 2
  1351. a621 2
  1352. #endif /* SYSINFO */
  1353.   
  1354. d623 4
  1355. a626 1
  1356.         if (kmem < 0)
  1357. d628 1
  1358. a630 1
  1359.     
  1360. d633 3
  1361. a635 3
  1362. #endif /* macII */
  1363. #if defined(sun) || defined (UTEK) || defined(sequent) || \
  1364.     defined(alliant) || defined(hp9000) || defined(sgi) || defined(NeXT)
  1365. d641 2
  1366. a642 2
  1367. #else /* else not sun */
  1368. # ifdef macII
  1369. d648 2
  1370. a649 2
  1371. # else /* else not macII */
  1372. #  if defined(mips)
  1373. d655 1
  1374. a655 1
  1375. #  else /* not mips */
  1376. d657 3
  1377. a659 3
  1378. #  endif /* mips */
  1379. # endif /* macII */
  1380. #endif /* sun */
  1381. d662 5
  1382. a666 4
  1383. #endif /* LOADSTUB */
  1384. #endif /* KVM_ROUTINES */
  1385. #endif /* apollo */
  1386. #endif /* UMAX */
  1387. @
  1388.  
  1389.  
  1390. 1.6
  1391. log
  1392. @Multimax load average code.
  1393. @
  1394. text
  1395. @d219 1
  1396. a219 1
  1397. #if defined(sequent) && !defined(FSCALE)
  1398. d325 4
  1399. d511 1
  1400. a511 1
  1401.     defined(alliant) || defined(hp9000) || defined(sgi)
  1402. @
  1403.  
  1404.  
  1405. 1.5
  1406. log
  1407. @Apollo changes for -A nansi.
  1408. @
  1409. text
  1410. @d41 1
  1411. d43 73
  1412. d537 1
  1413. @
  1414.  
  1415.  
  1416. 1.4
  1417. log
  1418. @Updated for 4.3 BSD-reno.
  1419. @
  1420. text
  1421. @d71 5
  1422. d77 1
  1423. d79 1
  1424. d83 1
  1425. d87 1
  1426. d89 4
  1427. @
  1428.  
  1429.  
  1430. 1.3
  1431. log
  1432. @Fixes for SGI Iris and Next machines.
  1433. @
  1434. text
  1435. @d109 4
  1436. d383 1
  1437. a383 1
  1438. # ifndef sgi
  1439. @
  1440.  
  1441.  
  1442. 1.2
  1443. log
  1444. @Fixed apollo case.
  1445. @
  1446. text
  1447. @d98 1
  1448. a98 1
  1449. #ifdef mips
  1450. d128 1
  1451. a128 1
  1452. #ifdef sequent
  1453. d136 5
  1454. d335 4
  1455. d341 1
  1456. d379 1
  1457. d381 3
  1458. d416 1
  1459. a416 1
  1460.     defined(alliant) || defined(hp9000)
  1461. d430 1
  1462. a430 1
  1463. #  ifdef mips
  1464. @
  1465.  
  1466.  
  1467. 1.1
  1468. log
  1469. @Initial revision
  1470. @
  1471. text
  1472. @d144 1
  1473. a144 1
  1474.      static Bool    firstTime = TRUE;
  1475. d158 1
  1476. a158 1
  1477.          firstTime = FALSE;
  1478. @
  1479.